<!--The form for adding an announcement to the database-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-Transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
        <title>Rotaract DLSU</title>
        <meta http-equiv="Content-Type" content="text/html"/>
        <meta name="robots" content="index,follow"/>
        <meta name="distribution" content="global"/>
        <meta name="description" content=""/>
        <meta name="keywords" content=""/>
        <link href="css/style.css" rel="stylesheet" type="text/css" media="screen" />
        <link rel="stylesheet" href="css/jquery-ui-1.8.21.custom.css"/>
        <link rel="stylesheet" href="css/demos.css"/>
        <script src="js/jquery-1.7.2.min.js"></script>
        <script src="js/jquery.ui.core.js"></script>
        <script src="js/jquery.ui.widget.js"></script>
        <script src="js/jquery.ui.datepicker.js"></script>
        <script type="text/javascript" src="javascript/RegistrationValidation.js"></script>
        
        <script>
	$(function() {
		$( "#datepicker" ).datepicker({
			changeMonth: true,
			changeYear: true,
                        dateFormat: 'yy-mm-dd'
		});
	});
	</script>
</head>
<body>
<div id="container2">
  <div id="main2">
    <table width="100%" cellspacing="0" cellpadding="0">
      <tr>
        <td class="main_nav">
            <div id="main_text2"> 
          <center>
              <h2>Add an Announcement</h2>
              <br/>
              <br/>
            <form enctype = "multipart/form-data" name="imageUpload" action="RAC-addAnnouncementUI.php" method="POST" >
            <table border ="1" cellpadding="10" class="myTable">
                <tr>
                    <td><b>Title of announcement</b></td>
                    <td><input type="text" name="annTitle"/><label id="errortitle"></label></td>
                </tr>
                <tr>
                    <td><b>Image</b></td>
                    <td><input type="file" name="imageUpload"/></td>
                </tr>    
                <tr>
                    <td><b>Date of announcement</b></td>
                    <td><input type="text" name="annDate" id="datepicker"/><label id="errordate"></label></td>
                </tr>    
                <tr>
                    <td><b>Description</b></td>
                    <td><input type="text" name="annDesc"/><label id="errordesc"></label></td>
                </tr>
                    </table>
                <br/>
                <br/>
                <input type="submit" name="submit" value="Save" onClick="return validateAddAnn(this.form);"/>
            </form>
              <?php
                                
                    $confirm = '';
                    if (isset($_POST['submit'])){
                    include 'RAC-addAnnounce.php';

                    if($confirm){
                        echo "<h4>Addition Successful!</h4>";
                    }
                    else
                        echo "<h4>Announcement already exists!</h4>";
                    }
              ?>
          </center>
          </div>
          </td>
        
      </tr>
    </table>
  </div>
</div>
</body>
</html>
